<script src="https://cdn.firebase.com/v0/firebase.js"></script>
<?php $this->headScript()->appendFile($this->JS_PATH . 'jquery.dataTables.js'); ?>
<?php $this->headScript()->appendFile($this->JS_PATH . 'cue.js'); ?>
<?php $this->headLink()->appendStylesheet($this->CSS_PATH . 'lib/jquery.dataTables.css'); ?>
<?php $this->headLink()->appendStylesheet($this->CSS_PATH . 'cue.css'); ?>
<?php $this->headLink()->appendStylesheet($this->CSS_PATH . 'compiled/grids.css'); ?>

<script>
    var question_id_array = "<?php echo $this->question_ids; ?>";
</script>

<!-- this page specific styles -->

<div class="container-fluid">
    <div id="pad-wrapper" class="datatables-page">

        <?php if (!$this->showTemplate): ?>
        <!-- grid with .row-fluid -->
        <div class="grid-wrapper">
            <div class="row-fluid head">
                <div class="presentation-cnt">
                    <h1><?php echo $this->templateMessage; ?></h1>
                </div>
            </div>

        </div>
        <?php else: ?>
        

        <div class="row-fluid">
            <div class="span12">
                <input type="hidden" id="hashtagname" name="hashtagname" value="<?php echo $this->hashTagname; ?>"/>  
                <input type="hidden" id="q_url_id" name="q_url_id" value="<?php echo $this->q_url_id; ?>"/>  
                
                <table cellpadding="0" cellspacing="0" border="0" class="" id="cuetablelist">
                    <thead>
                        <tr role="row">
                            <th tabindex="0" rowspan="1" colspan="1" class="display-none">ID</th>
                            <th tabindex="0" rowspan="1" colspan="1">Question</th>
                            <th tabindex="0" rowspan="1" colspan="1">Answer</th>
                            <th tabindex="0" rowspan="1" colspan="1">&nbsp;</th>
                            <th tabindex="0" rowspan="1" colspan="1">&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody>


                        <?php foreach ($this->questionData as $_question): ?>

                            <tr class="question-cnt">

                                <td q_id="<?php echo $_question['q_id']; ?>"  class="question_id display-none"><?php echo $_question['q_id']; ?></td>
                                <td q_id="<?php echo $_question['q_id']; ?>"  class="question"><?php echo $_question['q_question']; ?></td>
                                <td class="center">

                                    <div class="field-box">

                                        <input q_id="<?php echo $_question['q_id']; ?>" type="text" class="answer span8"  value="<?php echo $_question['q_answer']; ?>" />

                                        <span class="alert-msg error-cnt display-none">
                                            <i class="icon-remove-sign"></i> Answer cannot be blank
                                        </span>

                                        <span class="alert-msg success-cnt display-none">
                                            <i class="icon-ok-sign"></i> Answer updated successfully
                                        </span>

                                    </div>

                                </td>
                                <td class="center">
                                    <a class="btn-flat success saveanswer" q_url_id="<?php echo $_question['q_url_id']; ?>" q_u_id ="<?php echo $_question['q_u_id']; ?>" q_id="<?php echo $_question['q_id']; ?>" >Save</a>
                                </td>
                                <td class="center">
                                    <a q_id="<?php echo $_question['q_id']; ?>" class="btn-flat success present">Present</a>
                                </td>

                            </tr>

                        <?php endforeach; ?>

                    </tbody>	
                </table>
            </div>
        </div>
    
        <?php endif; ?>
    </div>
</div>
